package com.cgy.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//教师表
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity//表示实体
@Table(name = "teacher")
public class Teacher {
	@Id//表示数据表中的主键
	@GeneratedValue(strategy = GenerationType.IDENTITY)//设置主键自增 
	private Integer tid;
	private String tname;
	private String tsex;
	private Integer tage;
	private String tphone;
	private Integer tCardId;//教师员工号
	private Integer tStatus;//状态
	private String tRemark;//备注
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="kid")
	private Keshi keshi;
}
